//
// Created by tracyhenry on 2022/7/19.
//

#ifndef DEVICE_ZIGBEE_H
#define DEVICE_ZIGBEE_H
#include <iostream>
#include "err.h"

using namespace std;

class SocketStatus
{
  public:
    int socketStatus;  //0代表闭合，1代表打开，2代表按下两次（无线开关）
};

class PirStatus
{
public:
    int has_people;
};

class HTDetectorStatus
{
public:
    int *temp;
    int *hump;
    bool isMinus;
};

class WLeakStatus
{
public:
    long alarm_status;
};

class GS529ABStatus
{
  public:
    long alarm_status;
    long low_battery;
    long tamper;
    long fault;
    long test_alarm_status;
    long remote_alarm_status;
    long hush_status;
    long end_life;
};

class AddProductEvent
{
    public:
      char* productKey;
      long address;
};


class DeviceZigbee
{
    private:
        void handlerDevStatus(string,string,int);

        void handleSyncData(string,string);
    public:
        DeviceZigbee(string data1,string data2);
        DeviceZigbee(string data1,string data2,int sync);
        Result result_err;    // 0 success,no 0 fail,
        string clusterId;
        long address;
        SocketStatus *socketStatus;
        GS529ABStatus *gs529AStatus;
        WLeakStatus *wleakStatus;
        PirStatus  *pirStatus;
        HTDetectorStatus *htDetectorStatus;
        AddProductEvent *addProductEvent;
};

#endif //DEVICE_ZIGBEE_H
